package ru.papergames.controller.commands
{
	import by.andronix.logger.Logger;
	
	import mx.logging.ILogger;
	
	import org.puremvc.as3.interfaces.IMediator;
	import org.puremvc.as3.interfaces.IProxy;
	import org.puremvc.as3.patterns.command.MacroCommand;
	
	import ru.papergames.model.proxies.PersistentProxy;
	import ru.papergames.model.proxies.SettingsProxy;
	
	public class BaseMacroCommand extends MacroCommand
	{
		
		protected function getMediator(mediatorName:String):IMediator {
			return facade.retrieveMediator(mediatorName);
		}	
		
		protected function getProxy(proxyName:String):IProxy {
			return facade.retrieveProxy(proxyName);
		}
		
		protected function get settingsProxy():SettingsProxy {
			return this.getProxy(SettingsProxy.NAME) as SettingsProxy;
		}
		
		protected function get persistentProxy():PersistentProxy {
			return this.getProxy(PersistentProxy.NAME) as PersistentProxy;
		}
		
		protected function get logger():ILogger {
			return Logger.getLogger(this);
		}
	}
}